home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / xemacs / xemacs-1.006 / xemacs-1 / lib / xemacs-19.13 / info / new-users-guide.info-1 < prev    next >
Encoding:
GNU Info File  |  1995-09-01  |  48.9 KB  |  1,264 lines

  1. This is Info file ../../info/new-users-guide.info, produced by
  2. Makeinfo-1.63 from the input file new-users-guide.texi.
  3.  
  4.    This file will serve as the User's Manual for the XEmacs editor.
  5.  
  6.    Copyright (C) 1985, 1986, 1988 Richard M. Stallman.  Copyright (C)
  7. 1991, 1992, 1993, 1994 Lucid, Inc.  Copyright (C) 1993, 1994 Sun
  8. Microsystems, Inc.
  9.  
  10.    Permission is granted to make and distribute verbatim copies of this
  11. manual provided the copyright notice and this permission notice are
  12. preserved on all copies.
  13.  
  14. 
  15. File: new-users-guide.info,  Node: Top,  Next: Intro,  Prev: (dir),  Up: (dir)
  16.  
  17.    The Emacs Editor ****************
  18.  
  19.    Emacs is the extensible, customizable, self-documenting real-time
  20. display editor.  This Info file will help you get started on using
  21. XEmacs.  It corresponds to XEmacs version 19.13.
  22.  
  23. * Menu:
  24.  
  25. * Intro::                       Introduction to XEmacs editor
  26.  
  27. Indices, nodes containing large menus
  28. * Key Index::                   An item for each standard Emacs key sequence.
  29. * Command Index::               An item for each command and function name
  30. * Variable Index::              An item for each variable in User-Guide
  31. * Concept Index::               An item for the concepts introduced
  32.  
  33. Entering, Exiting and Editing Emacs
  34. * Entering::                    Starting Emacs from the shell and Exiting
  35. * Windows and Menus::           Description of Pull-down menus
  36. * Edit::                        Basic Editing commands
  37.  
  38. Other Features of XEmacs
  39. * Customization Basics::        Customize Emacs menus and keybindings
  40. * Help::                        Help menu and other help commands
  41. * Modes::                       Major and Minor modes in XEmacs
  42. * Files::                       Visiting, Saving and Listing Files
  43. * Other Customizations::        Customizing Variables, Modes, etc
  44. * Select and Move::             Selecting text and moving text
  45. * Search and Replace::          Searching and Replacing text
  46.  
  47.  
  48.  
  49.  -- The Detailed Node Listing --
  50.  
  51. Entering and Exiting Emacs
  52.  
  53. * Enter::                       Entering Emacs from the shell
  54. * Frame::                       Basic information about the XEmacs Frame
  55. * Exiting::                     Exiting Emacs
  56. * Mode Line::                   Interpreting the mode line.
  57. * Echo Area::                   Bottom of the frame where you interact
  58.                                 with Emacs.
  59.  
  60. XEmacs Windows and Menus
  61.  
  62. * XEmacs Window::               Manipulating XEmacs Windows
  63. * Pull-down Menus::             Description of XEmacs Pull-down Menus
  64.  
  65. Pull-down menus
  66.  
  67. * File menu::                   Items on the File Menu
  68. * Edit menu::                   Items on the Edit Menu
  69. * Options Menu::                Items on the Options Menu
  70. * Buffers Menu::                Items on the Buffers Menu
  71. * Help menu::                   The Help Menu at the extreme right on
  72.                                 the frame
  73.  
  74. Basic Editing Commands
  75.  
  76. * Insert::                      Insert text in Emacs by simply typing at
  77.                                 the cursor position.
  78. * Cursor Position::             Moving Around the cursor in the buffer,
  79. * Erase::                       Different commands for erasing text
  80. * Numeric Argument::            Giving Numeric Arguments to commands
  81. * Undo::                        Undoing Changes made by mistake
  82.  
  83. Customize key bindings and menus
  84.  
  85. * Customizing key Bindings::    Changing Key Bindings
  86. * Customizing Menus::           Adding, Deleting, Enabling and Disabling Menus
  87.  
  88. Help
  89.  
  90. * The Help Menu::               Items on the Help Menu
  91.  
  92. Major and Minor Modes
  93.  
  94. * Major Modes::                 Choosing Major Modes
  95. * Minor Modes::                 Auto-Fill, Abbrev and other minor modes
  96.  
  97. Emacs Files
  98.  
  99. * File Names::                  How to type and edit file name arguments.
  100. * Visiting::                    Visiting a file prepares Emacs to edit the file.
  101. * Saving Files::                How to save Emacs files.
  102.  
  103. Other Customizations
  104.  
  105. * Setting Variables::           Customizing Emacs variables
  106. * Init File::                   Some examples of Lisp expressions in
  107.                                 .emacs file
  108.  
  109. Selecting and Moving Text
  110.  
  111. * Selecting Text::              Select a region of text by setting the Mark
  112. * Mouse::                       Selecting Text with Mouse
  113. * Region Operation::            Various ways to operate on a selected text
  114. * Moving Text::                 Moving Text
  115. * Accumulating text::           Accumulating Text from several buffers
  116.  
  117. No sub menu for the node search and replace
  118.  
  119. 
  120. File: new-users-guide.info,  Node: Intro,  Next: Key Index,  Prev: Top,  Up: Top
  121.  
  122. Introduction
  123. ************
  124.  
  125.    You are reading about XEmacs which is a self-documenting,
  126. customizable, extensible real-time display editor.
  127.  
  128.    XEmacs is a "display" editor because normally the text being edited
  129. is visible on the screen and is updated automatically as you type.
  130. *Note Display: ()Frame.
  131.  
  132.    It is a "real-time" editor because the display is updated very
  133. frequently, usually after each character or pair of characters you type.
  134. This minimizes the amount of information you must keep in your head as
  135. you edit.  *Note Real-time: ()Basic.
  136.  
  137.    It is advanced because it provides facilities that go beyond simple
  138. insertion and deletion: filling of text; automatic indentation of
  139. programs; viewing two or more files at once; and dealing in terms of
  140. characters, words, lines, sentences, paragraphs, and pages, as well as
  141. expressions and comments in several different programming languages.
  142. It is much easier to type one command meaning "go to the end of the
  143. paragraph" than to find that spot with simple cursor keys.
  144.  
  145.    "Self-documenting" means that at any time you can type a special
  146. character, `Control-h', to find out what your options are.  You can
  147. also use `C-h' to find out what a command does, or to find all the
  148. commands relevant to a topic.  *Note Help: ()Help.
  149.  
  150.    "Customizable" means you can change the definitions of Emacs
  151. commands.  For example, if you use a programming language in which
  152. comments start with `<**' and end with `**>', you can tell the Emacs
  153. comment manipulation commands to use those strings (*note Comments:
  154. ()Comments.).  Another sort of customization is rearrangement of the
  155. command set.  For example, you can set up the four basic cursor motion
  156. commands (up, down, left and right) on keys in a diamond pattern on the
  157. keyboard if you prefer.  *Note Customization: ()Customization.
  158.  
  159.    "Extensible" means you can go beyond simple customization and write
  160. entirely new commands, programs in the Lisp language to be run by
  161. Emacs's own Lisp interpreter.  Emacs is an "on-line extensible" system:
  162. it is divided into many functions that call each other.  You can
  163. redefine any function in the middle of an editing session and replace
  164. any part of Emacs without making a separate copy of all of Emacs.  Most
  165. of the editing commands of Emacs are written in Lisp; the few
  166. exceptions could have been written in Lisp but are written in C for
  167. efficiency.  Only a programmer can write an extension to Emacs, but
  168. anybody can use it afterward.
  169.  
  170. 
  171. File: new-users-guide.info,  Node: Entering,  Next: Windows and Menus,  Prev: Concept Index,  Up: Top
  172.  
  173. Entering and Exiting Emacs
  174. **************************
  175.  
  176.    While using Emacs you should be familiar with the following three
  177. terms:
  178.  
  179. Buffer
  180.      A buffer is a region of memory holding characters. It is the basic
  181.      editing unit; one buffer corresponds to one piece of text being
  182.      edited. You can have multiple buffers but you can edit only one
  183.      buffer at any one time. For more information, *Note Buffers:
  184.      ()Buffers.
  185.  
  186. File
  187.      A file is a region of disk space holding characters. Emacs edits a
  188.      file by reading it into a buffer, editing that buffer and writing
  189.      out the buffer back to the file. To save your work permanently you
  190.      have to write it to a file.  So after you load and work with a
  191.      file, you have to save it back.
  192.  
  193. Windows
  194.      A window is a rectangular region in which a buffer is displayed.
  195.      You can open multiple windows with multiple buffers and edit them
  196.      by selecting the corresponding buffer. Initially, when you start
  197.      emacs, it will automatically open up a window for you.
  198.  
  199. * Menu:
  200.  
  201. * Enter::                       Entering Emacs from the shell
  202. * Frame::                      Basic information about the XEmacs Frame
  203. * Exiting::                     Exiting Emacs
  204. * Mode Line::                   Interpreting the mode line.
  205. * Echo Area::                   Bottom of the frame where you interact
  206.                                 with Emacs.
  207.  
  208. 
  209. File: new-users-guide.info,  Node: Enter,  Next: Frame,  Prev: Entering,  Up: Entering
  210.  
  211. Entering Emacs
  212. ==============
  213.  
  214.    To enter Emacs type `xemacs' and press the Return key at the shell
  215. i.e. `xemacs RET'.  This will bring up an emacs window with `*scratch*'
  216. as the default buffer because Emacs must always have a buffer to work
  217. on. Then choose the Open... option from the File menu on the menubar at
  218. the top of the frame. It will prompt you to enter a filename. After you
  219. enter the filename, Emacs will read that file into the current buffer.
  220. You can also type :
  221.      `xemacs <filename> RET'
  222.    directly which will bring up an Emacs frame with the "filename" as
  223. the buffer.
  224.  
  225. 
  226. File: new-users-guide.info,  Node: Frame,  Next: Exiting,  Prev: Enter,  Up: Entering
  227.  
  228. Emacs Frame
  229. ===========
  230.  
  231.    When you run XEmacs under X, a menu bar on top of the Emacs frame
  232. provides access to pull-down menus of file, edit, and help-related
  233. commands. The menus only provide convenient shortcuts, the options that
  234. they provide are available via key commands. You can invoke those
  235. commands from the keyboard also. For many of the options, their
  236. corresponding key commands are displayed right besides them. The five
  237. default menus on the menubar that you will see on the frame are File,
  238. Edit, Options, Buffers and Help. *Note XEmacs Pull-down Menus: ()XEmacs
  239. Pull-down Menus, for detailed information on the functions provided by
  240. the pull-down menus.
  241.  
  242.    The Emacs frame has a rectangle shaped box at the extreme right and
  243. you can drag it up or down to scroll the window accordingly. Clicking
  244. on the arrows also serves the same purpose.
  245.  
  246.    The last line in your window is `the Mode line' which will give you
  247. a description of what's going on in that particular window. *Note Mode
  248. Line::, for more information. Below the mode line is the `Echo area'.
  249. Emacs uses this area to interact with the user. *Note Echo Area::.
  250.  
  251.    If you wish to open another file in a new window after you enter
  252. XEmacs, select Open in New Frame... from the File menu, which will
  253. prompt you for a filename and open a new window with that filename as
  254. the current buffer. If you want to open a new file in the same window,
  255. select Open.. from the File menu. You need to enter XEmacs only once,
  256. you can edit multiple files by opening several other frames or by
  257. switching between buffers.
  258.  
  259. 
  260. File: new-users-guide.info,  Node: Exiting,  Next: Mode Line,  Prev: Frame,  Up: Entering
  261.  
  262. Exiting Emacs
  263. =============
  264.  
  265.    There are two commands for exiting Emacs, one for "suspending" Emacs
  266. and the other for "killing" Emacs. "Suspending" means stopping Emacs
  267. temporarily and returning control to the shell, allowing you to resume
  268. editing later in the same Emacs job, with the same files, same kill
  269. ring, same undo history, and so on.  This is the usual way to exit.
  270. "Killing" Emacs means destroying the Emacs job.  You can run Emacs
  271. again later, but you will get a fresh Emacs; there is no way to resume
  272. the same editing session after it has been killed.
  273.  
  274. `C-z'
  275.      Suspend Emacs (`suspend-emacs').  If used under the X window
  276.      system, this command will shrink the X window containing the Emacs
  277.      frame to an icon. Clicking on the icon will resume that Emacs
  278.      process again. *Note Exiting Emacs: ()Exiting Emacs.
  279.  
  280. `C-x C-c'
  281.      Kill Emacs (`save-buffers-kill-emacs'). You can also select Exit
  282.      Emacs option from the File menu to kill that Emacs process. If you
  283.      haven't saved the file, Emacs will ask you if you wish to save the
  284.      file before killing that process.
  285.  
  286. 
  287. File: new-users-guide.info,  Node: Mode Line,  Next: Echo Area,  Prev: Exiting,  Up: Entering
  288.  
  289. The Mode Line
  290. =============
  291.  
  292.    When you enter XEmacs, each text window's last line is a "mode line"
  293. which describes what is going on in that window. Normally, the mode
  294. line looks like :
  295.  
  296.      --CH-XEmacs: BUF     (MAJOR MINOR)----POS------
  297.  
  298. This gives information about the buffer being displayed in the window:
  299. the buffer's name, what major and minor modes are in use, whether the
  300. buffer's text has been changed, and how far down the buffer you are
  301. currently looking.
  302.  
  303.    The CH contains :
  304. `**'
  305.      if the text in the buffer has been edited
  306.  
  307. `--'
  308.      if the text in the buffer has not been edited
  309.  
  310. `%%'
  311.      if the buffer is a read-only-buffer i.e. it cannot be edited
  312.  
  313.    BUF is the name of the window's chosen "buffer". If you are editing
  314. a file (which is the selected buffer), the file name appears in BUF.
  315. *Note Buffers: ()Buffers.
  316.  
  317.    POS contains :
  318. `All'
  319.      if your entire file is visible on the screen.
  320.  
  321. `Top'
  322.      if you are looking at the beginning of the file.
  323.  
  324. `Bot'
  325.      if you are looking at the end of the file.
  326.  
  327. `NN%'
  328.      NN will be a number corresponding to the percentage of the file
  329.      above the top of the screen, for example `52', which means that 52%
  330.      of the file is above the top of the screen.
  331.  
  332.    MAJOR is the name of the "major mode" in effect in the buffer.  At
  333. any time, each buffer is in one and only one major mode.  The available
  334. major modes include Fundamental mode (the least specialized), Text
  335. mode, Lisp mode, and C mode.  *Note Major Modes: ()Major Modes, for
  336. details on how the modes differ and how you select one.
  337.  
  338.    MINOR is a list of some of the "minor modes" that are turned on in
  339. the window's chosen buffer.  For example, `Fill' means that Auto Fill
  340. mode is on which means that lines are broken automatically when they
  341. become too wide. *Note Minor Modes: ()Minor Modes, for more information
  342. on various minor modes and how to enable them.
  343.  
  344.    You can also display time in the mode line. *Note The Mode Line:
  345. ()The Mode Line, for more information regarding the mode line.
  346.  
  347. 
  348. File: new-users-guide.info,  Node: Echo Area,  Prev: Mode Line,  Up: Entering
  349.  
  350. The Echo Area
  351. =============
  352.  
  353.    The line at the bottom of the frame (below the mode line) is the
  354. "echo area".  Emacs uses this area to communicate with you:
  355.  
  356.    *   The "echo area" will print out the characters that you type. For
  357.      example, if you choose the Open... option from the File menu you
  358.      might get the following in the echo area:
  359.  
  360.           Find file: /usr/lib/x11/
  361.  
  362.      Now you need to give a file name to open, for example if the file
  363.      name is `myfile', you will type `myfile' after `/usr/lib/x11/' and
  364.      press the Return key. If you pause for more than a second while
  365.      typing, you will see the characters that you type in the "echo
  366.      area".
  367.  
  368.    *   The "echo area" also prints error messages. For example, if you
  369.      misspell `usr' and type `/urs/lib/x11/myfile' RETURN in the above
  370.      example you might get an error message. Since Emacs will not be
  371.      able to find the `/urs' directory, the "echo area" will say:
  372.  
  373.           error--> Opening directory: no such file or directory, /urs/lib/x11/myfile
  374.  
  375.      This error message will be accompanied by a beep. Some XEmacs
  376.      commands will print informative messages in the "echo area". *Note
  377.      The Echo Area: ()The Echo Area, for more information on the "echo
  378.      area".
  379.  
  380. 
  381. File: new-users-guide.info,  Node: Windows and Menus,  Next: Edit,  Prev: Entering,  Up: Top
  382.  
  383. XEmacs Windows and Menus
  384. ************************
  385.  
  386.    The first section of this chapter will show you how you can
  387. manipulate XEmacs Windows and the other section will explain the
  388. Pull-down Menus of an XEmacs window.
  389.  
  390. * Menu:
  391.  
  392. * XEmacs Window::               Manipulating XEmacs Windows
  393. * Pull-down Menus::             Description of XEmacs Pull-down Menus
  394.  
  395. 
  396. File: new-users-guide.info,  Node: XEmacs Window,  Next: Pull-down Menus,  Prev: Windows and Menus,  Up: Windows and Menus
  397.  
  398. XEmacs Windows
  399. ==============
  400.  
  401.    When you use XEmacs under X, you can open multiple windows and each
  402. window can display one buffer or multiple parts of one buffer. Each
  403. window will have its own "mode line" and "echo area". At any one time
  404. there is only one "selected window" and the buffer it displays is the
  405. "selected buffer". There are some commands for manipulating windows:
  406.  
  407. `M-C-v'
  408.      This command will scroll the window which is not "selected"
  409.      (`scroll-other-window').
  410.  
  411. `C-x 0'
  412.      This command will get rid of the selected window (`delete-window').
  413.      That is a zero. If there is more than one Emacs frame, deleting the
  414.      sole remaining window on that frame deletes the frame as well. If
  415.      the current frame is the only frame, it is not deleted.
  416.  
  417. `C-x 1'
  418.      This command will get rid of all the windows except the selected
  419.      one.  (`delete-other-windows'). For example, if you use the
  420.      Describe variable option from the Help menu, the window will split
  421.      vertically and the bottom window will contain documentation for
  422.      that variable. After you are done looking at that variable's
  423.      documentation you might want to come back to your original single
  424.      window. Just type `C-x 1' after your cursor is in the top window
  425.      (the window which you want to keep) and hit RET.
  426.  
  427. `C-x 2'
  428.      This command will split the selected window into two windows, one
  429.      above the other (`split-window-vertically'). Both the windows will
  430.      start out by displaying the same buffer. The window in which you
  431.      have your cursor will be your "selected window".
  432.  
  433. `C-x 3'
  434.      This will split the selected window into two windows positioned
  435.      side by side (`split-window-horizontally'). A line of vertical
  436.      bars will separate the window.
  437.  
  438. You can select a buffer in another window by using some other commands.
  439. These commands all have a prefix key `C-x 4'
  440. `C-x 4 b BUFNAME RET'
  441.      This command will select a buffer BUFNAME in another window.  This
  442.      runs `switch-to-buffer-other-window'. It will prompt you for a
  443.      buffername.
  444.  
  445. `C-x 4 f FILENAME RET'
  446.      Visit file FILENAME and select its buffer in another window.  This
  447.      runs `find-file-other-window'.  *Note Visiting: ()Visiting. It
  448.      will prompt you for a filename.
  449.  
  450. `C-x 4 d DIRECTORY RET'
  451.      Select a Dired buffer for directory DIRECTORY in another window.
  452.      This runs `dired-other-window'.  *Note Dired: ()Dired.
  453.  
  454. `C-x 4 m'
  455.      Start composing a mail message in another window.  This runs
  456.      `mail-other-window', and its same-window version is `C-x m'.
  457.      *Note Sending Mail: ()Sending Mail, for information on how to Send
  458.      Mail using XEmacs. *Note Reading Mail With Rmail: ()Reading Mail
  459.      With Rmail, for information on reading mail using Rmail.
  460.  
  461.    If you click the right button on the mouse on a mode line, you will
  462. get a menu with following options:
  463. Delete Window
  464.      Choosing this menu will remove the window above this modeline from
  465.      the frame.
  466.  
  467. Delete Other Windows
  468.      Delete all windows on the frame except for the one above this
  469.      modeline.
  470.  
  471. Split Window
  472.      Split the window above the mode line in half, creating another
  473.      window.
  474.  
  475. Split Window Horizontally
  476.      Split the window above the mode line in half horizontally, so that
  477.      there will be two windows side-by-side.
  478.  
  479. Balance Windows
  480.      Readjust the sizes of all windows on the frame until all windows
  481.      have roughly the same number of lines.
  482.  
  483. 
  484. File: new-users-guide.info,  Node: Pull-down Menus,  Prev: XEmacs Window,  Up: Windows and Menus
  485.  
  486. XEmacs Pull-down Menus
  487. ======================
  488.  
  489.    When you run XEmacs under X, each Emacs frame has a menu-bar at the
  490. top which provides commands for editing, help and other options. All
  491. these options are also available via key commands, the menus just
  492. provide convenient short-cuts. The key commands are displayed right
  493. besides some of the the options. The following is a brief description
  494. of the four default menus on the menu bar:
  495.  
  496. * Menu:
  497.  
  498. * File menu::                   Items on the File menu
  499. * Edit menu::                   Items on the Edit menu
  500. * Options Menu::                Items on the Options Menu
  501. * Buffers Menu::                Items on the Buffers Menu
  502. * Help menu::                   The Help Menu at the extreme right on
  503.                                 the frame
  504.  
  505. 
  506. File: new-users-guide.info,  Node: File menu,  Next: Edit menu,  Prev: Pull-down Menus,  Up: Pull-down Menus
  507.  
  508. The File Menu
  509. -------------
  510.  
  511.    The File menu bar contains the following items. To choose a
  512. particular option, press the left mouse button and drag it to the item
  513. you wish to select. Then release the button.
  514.  
  515. Open...
  516.      This option will prompt you for a file name. You will get a
  517.      message in the echo area:
  518.  
  519.           Find File:
  520.  
  521.      After Find File, there might be a directory path also. After you
  522.      type the file name and press RET the file will be loaded into a new
  523.      buffer.
  524.  
  525. Open in New Frame...
  526.      It prompts you for a file name and loads that file in a new buffer
  527.      in a new frame. You can open many frames for the same Emacs
  528.      session. You can delete the frame by selecting Delete Frame.
  529.  
  530. Insert File...
  531.      Prompts you for a filename and inserts the contents of this
  532.      filename in your current buffer. Position your cursor at the place
  533.      you wish to insert the file and select this option. You will get
  534.      the following message in the echo area:
  535.  
  536.           Insert file:
  537.  
  538.      Insert the file name and press RET.
  539.  
  540. Save <Buffername>
  541.      It saves the changes you have made to the buffer. If you have made
  542.      changes which are not saved yet, the option will appear dark,
  543.      otherwise it will be light and unselectable. If you do not wish to
  544.      save the changes, select Revert Buffer.
  545.  
  546. Save As...
  547.      Prompts you for a filename and saves the current buffer in that
  548.      file. It loads the new file if the filename you specify is
  549.      different from the one you were working with.
  550.  
  551. Print Buffer <buffername>
  552.      Prints a hardcopy of the current or "selected" buffer.
  553.  
  554. New Frame
  555.      Opens a new frame with *scratch* as the default buffer. It doesn't
  556.      prompt you for a filename. To open a file you need to go to that
  557.      frame and select Open...
  558.  
  559. Split Frame
  560.      Splits the current window into two equal-sized windows with the
  561.      same buffer. To get back a single frame, select Un-Split (Keep
  562.      This). *Note XEmacs Window::, for more information about windows.
  563.  
  564. Un-Split (Keep This)
  565.      If the frame contains multiple windows, it will remove all windows
  566.      except the selected one.
  567.  
  568. Un-Split (Keep Others)
  569.      If the frame contains multiple windows, it will remove the selected
  570.      window and keep the other one.
  571.  
  572. Revert Buffer <buffername>
  573.      If you do not wish to save the changes you made to the file since
  574.      you opened it, select this option. It will restore the last saved
  575.      version of the file to the current buffer.
  576.  
  577. Kill Buffer <buffername>
  578.      It will kill the current buffer. If will prompt you if there are
  579.      unsaved changes.
  580.  
  581. Exit Emacs
  582.      It will kill the Emacs "process" as opposed to simply killing the
  583.      "buffer". Before it kills the process, it will prompt you as to
  584.      which unsaved buffers you wish to save by going through the list
  585.      of the buffers.
  586.  
  587. * Menu:
  588.  
  589. * Edit menu::                   Items on the Edit Menu
  590. * Options Menu::                Items on the Options Menu
  591. * Buffers Menu::                Items on the Buffers Menu
  592. * Help menu::                   The Help Menu at the extreme right on
  593.                                 the frame
  594.  
  595. 
  596. File: new-users-guide.info,  Node: Edit menu,  Next: Options Menu,  Prev: File menu,  Up: Pull-down Menus
  597.  
  598. The Edit Menu
  599. -------------
  600.  
  601.    Most of the commands in this menu work on a block of text or a
  602. selected region. The text will be highlighted as you select it.
  603. Undo
  604.      Undoes the previous command.  If you type something by mistake you
  605.      can use this command. For example, if you select Insert File...
  606.      from the File menu and insert a wrong file by mistake, you can
  607.      select this item and it will remove the inserted file. It undoes a
  608.      batch of text which is worth an emacs command.
  609.  
  610. Cut
  611.      Removes the selected text block from the current buffer, makes it
  612.      the X clipboard selection, and places it in the kill ring (*note
  613.      Moving Text::.). Before executing this command, you have to select
  614.      a region using Emacs region selection commands or with the mouse.
  615.      *Note Selecting Text::.
  616.  
  617. Copy
  618.      Makes a selected text block the X clipboard selection, and places
  619.      it in the kill ring.  You can select text using one of the Emacs
  620.      region selection commands or by selecting a text region with the
  621.      mouse. *Note Selecting Text::, for more information.
  622.  
  623. Paste
  624.      Inserts the current value of the X clipboard selection in the
  625.      current buffer.  Note that this is not necessarily the same as the
  626.      Emacs `yank' command, because the Emacs kill ring and the X
  627.      clipboard selection are not the same thing.  You can paste in text
  628.      you have placed in the clipboard using Copy or Cut.  You can also
  629.      use Paste to insert text that was pasted into the clipboard from
  630.      other applications. *Note X Clipboard Selection: ()X Clipboard
  631.      Selection, for information on using Clipboard Selection.
  632.  
  633. Clear
  634.      Removes the selected text block from the current buffer but does
  635.      not place it in the kill ring or the X clipboard selection. You
  636.      will not be able to get this text back.
  637.  
  638. Start Macro Recording
  639.      After selecting this, Emacs will remember every keystroke you type
  640.      until End Macro Recording is selected.
  641.  
  642. End Macro Recording
  643.      Selecting this tells emacs to stop remembering your keystrokes.
  644.  
  645. Execute Last Macro
  646.      Selecting this item will cause emacs to re-interpret all of the
  647.      keystrokes which were saved between selections of the Start Macro
  648.      Recording and End Macro Recording menu items.  You can now execute
  649.      the most recent keyboard macro. *Note Keyboard Macros: ()Keyboard
  650.      Macros, for further information.
  651.  
  652. 
  653. File: new-users-guide.info,  Node: Options Menu,  Next: Buffers Menu,  Prev: Edit menu,  Up: Pull-down Menus
  654.  
  655. The Options Menu
  656. ----------------
  657.  
  658.    There are sub-menus for some of the menus which you will need to
  659. select. If sub-menus exist for an item, they will be displayed
  660. automatically when you drag the mouse on that item. The items in this
  661. menu provide some fancy editing operations.
  662.  
  663. Read Only
  664.      Selecting this item will cause the buffer to visit the file in a
  665.      read-only mode. Changes to the file will not be allowed.
  666.  
  667. Case Sensitive Search
  668.      Selecting this item will cause searches to be case-sensitive. If
  669.      its not selected then searches will ignore case. This option is
  670.      local to the buffer. For example, if this item is selected and you
  671.      are searching for `Smile', then an occurrence of `smile' will not
  672.      be recognized because of the smaller case of `s'.
  673.  
  674. Overstrike
  675.      After selecting this item, when you type letters they will replace
  676.      existing text on a one-to-one basis, rather than pushing it to the
  677.      right. At the end of a line, such characters extend the line.
  678.      Before a tab, such characters insert until the tab is filled in.
  679.  
  680. Auto Delete Selection
  681.      Selecting this item will cause automatic deletion of the selected
  682.      region. After you select a region and hit the RET key, the
  683.      selected text will be deleted. The typed text will replace the
  684.      selection if the selection is active (i.e. if its highlighted). If
  685.      the option is not selected then the typed text is just inserted at
  686.      the cursor.
  687.  
  688. Teach Extended Commands
  689.      After you  select this item, any time you execute a command with
  690.      `M-x' which has a shorter keybinding, you will be shown the
  691.      alternate binding before the command executes. For example if you
  692.      type `M-x find-file-other-window' which performs the same function
  693.      as the Open in New Frame... in File menu you will see the following
  694.      message:
  695.  
  696.           M-x find-file-other-frame (bound to keys: C-x 4 f, C-x 4 C-f)
  697.  
  698. Syntax Highlighting
  699.      You can customize your `.emacs' file to include the font-lock mode
  700.      so that when you select this item, the comments will be displayed
  701.      in one face, strings in another, reserved words in another, and so
  702.      on. *Note Customization: ()Customization, for more information on
  703.      customizing `.emacs' file.  After selecting this item, you will
  704.      find your code a lot easier to read. When Fonts is selected,
  705.      different parts of the program will appear in different Fonts.
  706.      When Colors is selected, then the program will be displayed in
  707.      different colors. Selecting None causes the program to appear in
  708.      just one Font and Color. Selecting Less resets the Fonts and Colors
  709.      to a fast, minimal set of decorations. Selecting More resets the
  710.      Fonts and Colors to a larger set of decorations. For example, if
  711.      Less is selected (which is the default setting) then you might have
  712.      all comments in green color. It does not matter what the comments
  713.      contain. Whereas, if More is selected then a function name in the
  714.      comments themselves might appear in a different Color or Font. Even
  715.      though the comments themselves might appear in green color, a
  716.      function name "within" the comments might appear in red color.
  717.  
  718. Paren Highlighting
  719.      After selecting Blink from this item, if you place the cursor on a
  720.      parenthesis, the matching parenthesis will blink. If you select
  721.      Highlight and place the cursor on a parenthesis, the whole
  722.      expression of the parenthesis under the cursor will be highlighted.
  723.      Selecting None will turn off the options (regarding Paren
  724.      Highlighting) which you had selected earlier.
  725.  
  726. Font
  727.      You can select any Font for your program by choosing from one of
  728.      the available Fonts. The whole buffer will be converted to the
  729.      Font you select.
  730.  
  731. Size
  732.      You can select any size for the text in your buffer (ranging from
  733.      2 to 24) by selecting the appropriate option.
  734.  
  735. Weight
  736.      You can choose either Bold or Medium for the weight of the text of
  737.      your buffer.
  738.  
  739. Buffers Menu Length...
  740.      Prompts you for the number of buffers to display. Then it will
  741.      display that number of most recently selected buffers.
  742.  
  743. Buffers Sub-Menus
  744.      After selection of this item the Buffers menu will contain several
  745.      commands, as submenus of each buffer line. If this item is
  746.      unselected, then there are no submenus for each buffer line, the
  747.      only command available will be selecting that buffer.
  748.  
  749. Save Options
  750.      Selecting this item will save the current settings of your Options
  751.      menu to your `.emacs' file so that the next time you start XEmacs,
  752.      you won't need to select the options again.
  753.  
  754. 
  755. File: new-users-guide.info,  Node: Buffers Menu,  Next: Help menu,  Prev: Options Menu,  Up: Pull-down Menus
  756.  
  757. The Buffers Menu
  758. ----------------
  759.  
  760.    The Buffers menu provides a selection of up to ten buffers and the
  761. item List All Buffers, which provides a Buffer List. If you select
  762. Buffers Sub-menus from the Options menu, you will get some sub-menus
  763. for each of the buffer listing.
  764.  
  765. 
  766. File: new-users-guide.info,  Node: Help menu,  Prev: Buffers Menu,  Up: Pull-down Menus
  767.  
  768. The Help Menu
  769. -------------
  770.  
  771.    The Help Menu gives you access to Emacs Info and provides a menu
  772. equivalent for some of the choices you have when using `C-h'.  *Note
  773. Help::, for more information.
  774.  
  775.    The Describe variable and Describe function will provide
  776. documentation for the corresponding variable or function. The Help menu
  777. also gives access to UNIX online manual pages via the UNIX Manual...
  778. option.
  779.  
  780. 
  781. File: new-users-guide.info,  Node: Edit,  Next: Customization Basics,  Prev: Windows and Menus,  Up: Top
  782.  
  783. Basic Editing Commands
  784. **********************
  785.  
  786.    This chapter will introduce you to some basic editing commands. You
  787. can also learn the basic editing commands by typing `Control-h t'
  788. (`help-with-tutorial' OR by selecting Emacs Tutorial from the Help menu
  789. on the menu bar. Most of the Emacs commands will use the CONTROL key or
  790. the META key. The following abbreviations will be used for the CONTROL
  791. and META key in this manual:
  792.  
  793. `C-<chr>'
  794.      This means that you should hold down the CONTROL key while typing
  795.      `<chr>'. For example, if the command is `C-g', you should hold the
  796.      CONTROL key and type g.
  797.  
  798. `M-<chr>'
  799.      This means that you should hold down the `META' key while typing
  800.      `<chr>'. If there is no `META' key on your keyboard, use the `ESC'
  801.      key instead. For example, if the command is `M-x', then type
  802.      `ESC', release it and type `x'.
  803.  
  804.    The following abbreviations will be used for some other keys:
  805.  
  806. SPC
  807.      Space bar.
  808.  
  809. RET
  810.      Return key.
  811.  
  812. LFD
  813.      Linefeed key.
  814.  
  815. TAB
  816.      Tab.
  817.  
  818. ESC
  819.      Escape.
  820.  
  821. SFT
  822.      Shift.
  823.  
  824. * Menu:
  825.  
  826. * Insert::                      Insert text in Emacs by simply typing at
  827.                                 the cursor position.
  828. * Cursor Position::             Moving Around the cursor in the buffer,
  829. * Erase::                       Different commands for erasing text
  830. * Numeric Argument::            Giving Numeric Arguments to commands
  831. * Undo::                        Undoing Changes made by mistake
  832.  
  833. 
  834. File: new-users-guide.info,  Node: Insert,  Next: Cursor Position,  Prev: Edit,  Up: Edit
  835.  
  836. Inserting Text
  837. ==============
  838.  
  839.    To insert printing characters into the text you are editing, just
  840. type them. Emacs will automatically insert the characters that you type
  841. into the buffer at the cursor. The cursor moves forward, but if you
  842. prefer to have text characters replace (overwrite) existing text
  843. characters, you can enable the Overstrike option from the Options menu
  844. in the menu bar.
  845.  
  846.    To "delete" text you have just inserted, use DEL.  DEL deletes the
  847. character BEFORE the cursor (not the one that the cursor is on top of
  848. or under; that is the character AFTER the cursor).  The cursor and all
  849. characters after it move backwards.  Therefore, if you type a printing
  850. character and then type DEL, they cancel out.
  851.  
  852.    To end a line and start typing a new one, type RET.  This inserts a
  853. newline character in the buffer.  If point is in the middle of a line,
  854. RET splits the line.  Typing DEL when the cursor is at the beginning of
  855. a line rubs out the newline before the line, thus joining the line with
  856. the preceding line.
  857.  
  858.    Emacs automatically splits lines when they become too long, if you
  859. turn on a special mode called "Auto Fill" mode.  *Note Filling:
  860. ()Filling, for information on using Auto Fill mode.
  861.  
  862. 
  863. File: new-users-guide.info,  Node: Cursor Position,  Next: Erase,  Prev: Insert,  Up: Edit
  864.  
  865. Moving Around
  866. =============
  867.  
  868.    The following commands will allow you to move the cursor around the
  869. screen. The actual function names corresponding to these commands are
  870. given in parenthesis. You can also invoke these commands by typing `M-x
  871. <function name>'. You can do this for any command in XEmacs.
  872.  
  873. `C-b'
  874.      Move the cursor backward one character (`backward-char').
  875.  
  876. `C-f'
  877.      Move the cursor forward one character (`forward-char').
  878.  
  879. `C-p'
  880.      Move the cursor up one line vertically (`previous-line').
  881.  
  882. `C-n'
  883.      Move the cursor down one line vertically (`next-line').
  884.  
  885. `C-a'
  886.      Move the cursor to the beginning of the line (`beginning-of-line').
  887.  
  888. `C-e'
  889.      Move the cursor to the end of the line (`end-of-line').
  890.  
  891. `M-f'
  892.      Move the cursor forward one word (`forward-word').
  893.  
  894. `M-b'
  895.      Move the cursor backword one word (`backward-word').
  896.  
  897. `M-<'
  898.      Move the cursor to the top of the buffer (`beginning-of-buffer').
  899.  
  900. `M->'
  901.      Move the cursor to the end of the buffer (`end-of-buffer').
  902.  
  903. `M-x goto-char RET <number> RET'
  904.      To enable this command type `M-x goto-char', and hit RETURN key.
  905.      In the "echo area" you will see:
  906.  
  907.           Goto char:
  908.  
  909.      You should then type in a number right after the colon and hit the
  910.      `RETURN' key again. After reading a number N this command will
  911.      move the cursor to character number N.  Position 1 is the
  912.      beginning of the buffer. For example, if you type `M-x goto-char
  913.      RET 200 RET', then the cursor will move to the 200th character
  914.      starting from the beginning of the buffer.
  915.  
  916. `M-x goto-line RET <number> RET'
  917.      To enable this command type `M-x goto-line', and hit the RETURN
  918.      key. After you see `Goto line:' in the "echo area", type in a
  919.      number N and hit RETURN key again. This command will position the
  920.      cursor on the nth line starting from the beginning of the buffer.
  921.  
  922. `M-x what-line RET'
  923.      This command will display the current line number in the echo area.
  924.  
  925. 
  926. File: new-users-guide.info,  Node: Erase,  Next: Numeric Argument,  Prev: Cursor Position,  Up: Edit
  927.  
  928. Erasing Text
  929. ============
  930.  
  931. `DEL'
  932.      If you press DEL i.e. the "delete" key, it will delete the
  933.      character before the cursor (`delete-backward-char').
  934.  
  935. `C-d'
  936.      This will delete the character after the cursor (`delete-char').
  937.  
  938. `C-k'
  939.      Kill to the end of the line (`kill-line'). If you kill the line by
  940.      mistake you can "yank" or `paste' it back by typing `C-y'. *Note
  941.      Moving Text::, for more information on yanking.
  942.  
  943. `M-d'
  944.      Kill forward to the end of the next word (`kill-word').
  945.  
  946. `M-DEL'
  947.      Kill back to the beginning of the previous word
  948.      (`backward-kill-word').
  949.  
  950. `M-k'
  951.      Kill to the end of current sentence (`kill-sentence').
  952.  
  953. `M-z CHAR'
  954.      Kill up to next occurrence of CHAR (`zap-to-char'). To use this
  955.      command type `M-z'. You will see the following statement in the
  956.      echo area :
  957.  
  958.           Zap to char:
  959.  
  960.      Type any char and press the RET key. For example, if you type `p'
  961.      then the entire text starting from the position of the cursor
  962.      until the first occurrence of `p' is killed.
  963.  
  964. 
  965. File: new-users-guide.info,  Node: Numeric Argument,  Next: Undo,  Prev: Erase,  Up: Edit
  966.  
  967. Giving Numeric Arguments
  968. ========================
  969.  
  970.    Any Emacs command can be given a "numeric argument".  Some commands
  971. interpret the argument as a repetition count.  For example, if you want
  972. to move forward ten characters, you could type `C-f' ten times.
  973. However, a more efficient way to do this would be to give an argument
  974. of ten to the key `C-f' (the command `forward-char', move forward one
  975. character). Negative arguments are also allowed. Often they tell a
  976. command to move or act backwards. For example, if you want to move down
  977. ten lines, type the following:
  978.      C-u 10 C-n RET
  979.  
  980. After you press RET key, the cursor will move ten lines downward. You
  981. can also type:
  982.      M-10 C-n RET
  983.  
  984. Both `C-u' and `M-' allow you to give numeric arguments. If you want to
  985. move ten lines backward, you can also give negative arguments, like:
  986.      C-u -10 C-n RET
  987.  
  988. OR you could also type:
  989.      M--10 C-n RET
  990.  
  991. You can obviously use `C-b' to move backward rather than giving
  992. negative arguments to `C-n'. *Note Numeric Arguments: ()Numeric
  993. Arguments, for more information on numeric arguments.
  994.  
  995. 
  996. File: new-users-guide.info,  Node: Undo,  Prev: Numeric Argument,  Up: Edit
  997.  
  998. Undoing Changes
  999. ===============
  1000.  
  1001.    When you are editing a buffer, you might type something by mistake.
  1002. Emacs allows you to undo all changes you make to a buffer (but not more
  1003. than 8000 characters). Each buffer in Emacs keeps a record of the
  1004. changes made to it individually, so the undo command applies to the
  1005. current buffer. There are two undo commands:
  1006.  
  1007. `C-x u'
  1008.      Undo one batch of changes (usually, one command's worth).
  1009.      (`undo').
  1010.  
  1011. `C-_'
  1012.      The same as above, but this command might not be obvious to type
  1013.      on some keyboards so it might be better to use the above command.
  1014.  
  1015.    *Note Undoing Changes: ()Undoing Changes, for more information on
  1016. undoing changes.
  1017.  
  1018. 
  1019. File: new-users-guide.info,  Node: Customization Basics,  Next: Help,  Prev: Edit,  Up: Top
  1020.  
  1021. Customize key bindings and menus
  1022. ********************************
  1023.  
  1024.    When you start Emacs, it reads the file `~/.emacs' in your home
  1025. directory. You can use this file to initialize and customize Emacs to
  1026. your liking. This file should contain lisp-code. You can customize your
  1027. `.emacs' file to create new menus, disable menus, change key bindings,
  1028. enable a minor mode, etc. Any kind of customization affects only a
  1029. particular Emacs job that you do them in. If you want to save your
  1030. customizations `permanently' i.e. for future use also, you have to put
  1031. it in your `.emacs' file. After you make changes to your `.emacs' file
  1032. and save it, the changes will be effective only after you start Emacs
  1033. again i.e. for a new Emacs process. To try out some of the examples in
  1034. this section, highlight that region and evaluate the region by giving
  1035. the command `M-x eval-region'. You will be able to see the results of
  1036. your customizations in that Emacs session only (*note Lisp Eval: ()Lisp
  1037. Eval.).
  1038.  
  1039. * Menu:
  1040.  
  1041. * Customizing key Bindings::    Changing Key Bindings
  1042. * Customizing Menus::           Adding, Deleting, Enabling and Disabling Menus
  1043.  
  1044. 
  1045. File: new-users-guide.info,  Node: Customizing key Bindings,  Next: Customizing Menus,  Prev: Customization Basics,  Up: Customization Basics
  1046.  
  1047. Customize key bindings
  1048. ======================
  1049.  
  1050.    Most of Emacs commands use key sequences. *Note Keystrokes:
  1051. ()Keystrokes, for more information about Keys and Commands. In Emacs,
  1052. the keys themselves carry no meaning unless they are bound to a
  1053. function. For example, `C-n' moves the cursor to the next line because
  1054. its bound to the function next-line. Similarly, `C-p' moves to the
  1055. previous line because its bound to the function previous-line. The
  1056. functions themselves define a particular behavior. You can customize
  1057. the key `C-n' to move to the previous line by binding it to
  1058. previous-line and `C-p' to move to the next line by binding it to
  1059. next-line. To bind keys to globally run commands you need to use the
  1060. following syntax in your .emacs file:
  1061.  
  1062.      `(global-set-key KEYS CMD)'
  1063.  
  1064. Here, `global-set-key' is a function which will bind the "keys" to the
  1065. specified "cmd". For example, if you type the following in your .emacs
  1066. file:
  1067.  
  1068.      (global-set-key "\C-p" 'next-line)
  1069.      (global-set-key "\C-n" 'previous-line)
  1070.  
  1071. then `C-p' will move to the next line and `C-n' to the previous line.
  1072.  
  1073.    You can also disable a key binding, by using `nil' as the CMD in the
  1074. syntax stated above. Here, `nil' stands for `false' which means disable
  1075. a command or turn off a feature. If you want to enable a command or
  1076. turn on a particular feature use `t' which stands for `true'.  For
  1077. example, if you do not wish `C-x C-c' to `Exit Emacs' you can type the
  1078. following expression in your `.emacs' file:
  1079.  
  1080.      (global-set-key "\C-x\C-c" nil)
  1081.  
  1082. You might want to have this statement in your `.emacs' file because its
  1083. easy to hit this command by mistake and it could be annoying to exit
  1084. Emacs unintentionally. There is a Exit Emacs option in the File menu
  1085. which you might want to use instead. To make a particular key undefined
  1086. you can also use:
  1087.  
  1088.      (global-unset-key "\C-x\C-c")
  1089.  
  1090. Now if you use the command `C-x C-c', you will get an error saying that
  1091. the command is undefined.
  1092.  
  1093.    Some other customizations you could try are:
  1094.    *      (global-set-key 'button3 'beginning-of-buffer)
  1095.  
  1096.      Now when you press the third button of your mouse, the cursor will
  1097.      be placed at the `beginning-of-buffer'.
  1098.  
  1099.    *      (global-set-key 'f1 'goto-line)
  1100.  
  1101.      If you press the F1 key, you will be prompted for a line number.
  1102.      After you type the line number and hit RET, the cursor will be
  1103.      placed on that line number.
  1104.  
  1105.    *      (global-set-key 'f2 'undo)
  1106.  
  1107.      Pressing F2 will undo the last command. If you have a undo key on
  1108.      your keyboard, try binding that key to the undo command.
  1109.  
  1110.    Another syntax for customizing key bindings is: `(define-key KEYMAP
  1111. KEYS DEF)' It defines KEYS to run DEF in the keymap KEYMAP.
  1112.  
  1113.    KEYMAP is a keymap object which records the bindings of keys to the
  1114. commands that they run.
  1115.  
  1116.    KEYS is the sequence of keystrokes to bind.
  1117.  
  1118.    DEF is anything that can be a key's definition:
  1119.  
  1120.    Look at the following two examples:
  1121.  
  1122.      (define-key global-map "\C-xl" 'make-symbolic-link)
  1123.      (define-key c-mode-map "\C-xl" 'make-symbolic-link)
  1124.  
  1125. Both the examples bind the key `C-xl' to run the function
  1126. `make-symbolic-link' (*note Misc File Ops: ()Misc File Ops.). However,
  1127. the second example will bind the key only for C mode. *Note Major
  1128. Modes: ()Major Modes, for more information on Major Modes in XEmacs.
  1129.  
  1130. 
  1131. File: new-users-guide.info,  Node: Customizing Menus,  Prev: Customizing key Bindings,  Up: Customization Basics
  1132.  
  1133. Customizing Menus
  1134. =================
  1135.  
  1136.    You can customize any of the  XEmacs Pull-down-Menus. You can create
  1137. your own menu, delete an existing one, enable a menu or disable a menu.
  1138. For more information on the default menus available to you, *Note
  1139. Pull-down Menus::.
  1140.  
  1141.    Some of the functions which are available to you for customization
  1142. are:
  1143.   1. add-menu-item: (MENU-NAME ITEM-NAME FUNCTION ENABLED-P &OPTIONAL
  1144.      BEFORE)
  1145.  
  1146.      This function will add a menu item to a menu, creating the menu
  1147.      first if necessary. If the named item already exists, the menu
  1148.      will remain unchanged. For example, if you add the following
  1149.      example to your `.emacs' file or evaluate it (*note Customization
  1150.      Basics::.),
  1151.  
  1152.           (add-menu-item '("Edit") "Replace String" replace-string t "Clear")
  1153.  
  1154.      a sub-menu Replace String will be created under Edit menu before
  1155.      the sub-menu Clear. The Edit menu will now look like:
  1156.  
  1157.           Undo                    C-x u
  1158.           Cut                     cut
  1159.           Copy                    copy
  1160.           Paste                   paste
  1161.           Replace String
  1162.           Clear
  1163.           Start Macro Recording   C-x(
  1164.           End Macro Recording     C-x)
  1165.           Execute Last Macro      C-xe
  1166.  
  1167.      Replace String will now execute the function `replace-string'.
  1168.      Select this menu item. Emacs will prompt you for a string name to
  1169.      be replaced. Type a string and hit RET. Now type a new string to
  1170.      replace the old string and hit RET. All occurrences of the old
  1171.      string will be replaced by the new string. In this example,
  1172.  
  1173.      `Edit' is the MENU-NAME which identifies the menu into which the
  1174.      new menu item should be inserted.
  1175.  
  1176.      `Replace String' is the ITEM-NAME which names the menu item to be
  1177.      added.
  1178.  
  1179.      `replace-string' is the FUNCTION i.e. the command to be invoked
  1180.      when the menu item "Replace String" is selected.
  1181.  
  1182.      `t' is the ENABLED-P parameter which controls whether the menu
  1183.      item is selectable or not. This parameter can be either `t'
  1184.      (selectable), `nil' (not selectable), or a form to evaluate. This
  1185.      form is evaluated just before the menu is displayed, and the menu
  1186.      item will be selectable if the form returns non-`nil'.
  1187.  
  1188.      `Clear' is the &OPTIONAL BEFORE parameter which is the name of the
  1189.      menu before which the new menu or sub-menu should be added. The
  1190.      &OPTIONAL string means that this parameter is optional. You do not
  1191.      need to specify this parameter. If you do not specify this
  1192.      parameter in the example above, the Replace String menu item will
  1193.      be added at the end of the list of sub-menus in the Edit menu i.e.
  1194.      after Execute Last Macro.
  1195.  
  1196.      If you wish to add a new menu to the menubar, try:
  1197.  
  1198.           (add-menu-item nil "Bot" 'end-of-buffer t)
  1199.  
  1200.      This will create a new menu Bot on the menu bar. Selecting this
  1201.      menu will take you to the end of the buffer. Using `nil' for the
  1202.      parameter MENU-NAME will create a new menu. Your menu-bar will now
  1203.      look like:
  1204.  
  1205.           File Edit Options Buffers Bot                         Help
  1206.  
  1207.      The following example will illustrate how you can add sub-menus to
  1208.      the submenus themselves:
  1209.  
  1210.           (add-menu-item '("File" "Management") "Copy File" 'copy-file t)
  1211.           (add-menu-item '("File" "Management") "Delete File" 'delete-file t)
  1212.           (add-menu-item '("File" "Management") "Rename File" 'rename-file t)
  1213.  
  1214.      This will create a sub-menu Management under the File menu. When
  1215.      you select the submenu Management, it will contain three submenus:
  1216.      Copy File, Delete File and Rename File.
  1217.  
  1218.   2. delete-menu-item: (MENU-PATH) This function will remove the menu
  1219.      item defined by MENU-NAME from the menu hierarchy. Look at the
  1220.      following examples and the comments just above them which specify
  1221.      what the examples do.
  1222.  
  1223.           ;; deletes the "Replace String" menu item created earlier
  1224.           (delete-menu-item '("Edit" "Replace String"))
  1225.           
  1226.           ;; deletes the "Bot" menu created earlier
  1227.           (delete-menu-item '("Bot"))
  1228.           
  1229.           ;; deletes the sub-menu "Copy File" created earlier
  1230.           (delete-menu-item '("File" "File Management" "Copy File"))
  1231.           
  1232.           ;; deletes the sub-menu "Delete File" created earlier
  1233.           (delete-menu-item '("File" "Management" "Delete File"))
  1234.           
  1235.           ;; deletes the sub-menu "Rename File" created earlier
  1236.           (delete-menu-item '("File" "Management" "Rename File"))
  1237.  
  1238.   3. disable-menu-item: (MENU-NAME) Disables the specified menu item.
  1239.      The following example
  1240.  
  1241.           (disable-menu-item '("File" "Management" "Copy File"))
  1242.  
  1243.      will make the Copy File item unselectable. This menu-item would
  1244.      still be there but it will appear faded which would mean that it
  1245.      cannot be selected.
  1246.  
  1247.   4. enable-menu-item: (MENU-NAME) Enables the specified previously
  1248.      disabled menu item.
  1249.  
  1250.           (enable-menu-item '("File" "Management" "Copy File"))
  1251.  
  1252.      This will enable the sub-menu Copy File, which was disabled by the
  1253.      earlier command.
  1254.  
  1255.   5. relabel-menu-item: (MENU-NAME NEW-NAME) Change the string of the
  1256.      menu item specified by MENU-NAME to NEW-NAME.
  1257.  
  1258.           (relabel-menu-item '("File" "Open...") "Open File")
  1259.  
  1260.      This example will rename the Open... menu item from the File menu
  1261.      to Open File.
  1262.  
  1263.  
  1264.